<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="utils.js"></script>

    <h1>获取随机颜色</h1>
    <div id="color"></div><br>
    <script>
        var arr = [0,1,2,3,4,5,6,7,8,9, 'A', 'B', 'C', 'D', 'E', 'F']
        var str = "#";
        document.querySelector('#color').innerHTML = color();
    </script>

    <h1>获取当前时间</h1>
    <div id="timer"></div><br>
    <script>
        //获取当前时间
        var result = "";
        result += `format('YmdHis')~~~~~~~~~~${format('YmdHis')}<br>`;
        result += `format('Y-m-d H:i:s')~~~~~${format('Y-m-d H:i:s')}<br>`;
        result += `format('Y-m-d ')~~~~~~~~~~${format('Y-m-d')}<br>`;
        document.querySelector('#timer').innerHTML = result;
    </script>


    <h1>获取未来的时间距离现在的时间</h1>
    <div id="demo1"></div><br>
    <script>
        //获取未来的时间距离现在的时间
        var result1 = "";
        result1 += weilai_time('2022-8-14 5:18:19');
        document.write = result1;
    </script>


    <h1>获取输入的时间距离现在的时间</h1>
    <div id="demo2"></div>
    <script>
        //获取输入的时间距离现在的时间
        var result2 = ""
        result2 += `dateFormat('2017-3-3 5:18:19') ~~~~~${dateFormat('2017-3-3 5:18:19')} <br>`
        result2 += `dateFormat('2022-1-3 5:18:19') ~~~~~${dateFormat('2022-1-3 5:18:19')} <br>`
        result2 += `dateFormat('2022-4-3 5:18:19') ~~~~~${dateFormat('2022-4-3 5:18:19')} <br>`
        result2 += `dateFormat('2022-4-14 5:18:19') ~~~~${dateFormat('2022-4-14 5:18:19')} <br>`
        document.querySelector('#demo2').innerHTML = result2
    </script>

    <h1>判断浏览器类型</h1>
    <div id="demo5"></div>
    <script>
        var result = ''
        result += ` browser()~~~~~~~~~~${ browser()}<br>`
        document.querySelector('#demo5').innerHTML = result
    </script>

    <!-- 判断是PC端还是移动端 -->
    <h1>判断是PC端还是移动端</h1>
    <div id="demo6"></div>
    <script>
        var result = ''
        result += `PcandYd()~~~~~~~~~~${PcandYd()}<br>`
        document.querySelector('#demo6').innerHTML = result
    </script>

    <!-- 判断是否是微信浏览器 -->
    <h1>判断是否是微信浏览器</h1>
    <div id="demo7"></div>
    <script>
        var result = ''
        result += `weixin()~~~~~~~~~~${weixin()}<br>`
        document.querySelector('#demo7').innerHTML = result 
    </script>

    <!-- 判断标签样式 -->
    <h1>判断标签样式</h1>
    <div id="demo8"></div>
    <script>
        var result = ''
        var divObj=document.querySelector('#demo8')
        result += `getStyle(divOBj,'color')~~~~~~~~~~${getStyle(divObj,'color')}<br>`
        result += `getStyle(divOBj,'fontSize')~~~~~~~~~~${getStyle(divObj,'fontSize')}<br>`
        result += `getStyle(divOBj,'width')~~~~~~~~~~${getStyle(divObj,'width')}<br>`
        document.querySelector('#demo8').innerHTML = result
    </script>
    <script>
        



</script>
</body>
</html>